//
//  RETabBar.m
//  ReelEp
//
//  Created by 孙强 on 2024/7/14.
//  Copyright © 2024 RE. All rights reserved.
//

#import "RETabBar.h"

@implementation RETabBar

- (instancetype)init{
    if (self = [super init]){
        [self initView];
    }
    return self;
}

- (void)initView{
    
//    self.barTintColor=COLOR_BG;
    self.barTintColor=colorFromHexString(@"1C0804");

    
//    CGRect rect = CGRectMake(0, 0, GJScreenW, 1);
//    UIGraphicsBeginImageContext(rect.size);
//    CGContextRef context = UIGraphicsGetCurrentContext();
//    CGContextSetFillColorWithColor(context, [COLOR_BG CGColor]);
//    CGContextFillRect(context, rect);
//    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
//    UIGraphicsEndImageContext();
//    [self setBackgroundImage:img];
//    [self setShadowImage:img];
    
    UIView *backView = [[UIView alloc] init];
    backView.frame = CGRectMake(0.0,0,GJScreenW,TabBarHeight);
    // gradient
    CAGradientLayer *gl = [CAGradientLayer layer];
    gl.frame = CGRectMake(0.0,0,GJScreenW,TabBarHeight);
    gl.startPoint = CGPointMake(1.07, 0.69);
    gl.endPoint = CGPointMake(1.07, 0);
    gl.colors = @[(__bridge id)colorFromHexString(@"1C0804").CGColor, (__bridge id)colorFromHexStringWithAlpha(@"1B1817", 0.86).CGColor];
    gl.locations = @[@(0), @(0.9f)];
    [backView.layer addSublayer:gl];
    [self addSubview:backView];
    
    _blackView = [[UIView alloc] initWithFrame:CGRectMake(0.0,0,GJScreenW,TabBarHeight)];
    _blackView.backgroundColor = colorFromHexString(@"171211");
    [self addSubview:_blackView];
    _blackView.hidden = YES;
    
   
//    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, HMScreenW, 0.5)];
//    line.backgroundColor = colorFromHexStringWithAlpha(@"747577", 0.1);
//    [self addSubview:line];
   
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
